<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>入门</title>
  </head>
  <body>
    <input type="text" id="name" />
    <input type="text" id="age" />
    <input type="text" id="score" />
    <input type="button" id="btn" value="提交" />
    <input type="button" id="reset" value="重置" />

    <table id="table">
      <tr>
        <td>姓名</td>
        <td>年龄</td>
        <td>分数</td>
      </tr>
    </table>

    <script src="../lib/jquery-1.10.1.js"></script>
    <script>
      $(function () {
        $("#btn").click(function () {
          let name = $("#name").val();
          let age = $("#age").val();
          let score = $("#score").val();
          let table = $("#table");
          $(` <tr>
            <td>${name}</td>
            <td>${age}</td>
            <td>${score}</td>
        </tr>`).appendTo(table);
        });

        $("#reset").click(function () {
          $("#name").val("");
          $("#age").val("");
          $("#score").val("");
        });
      });
    </script>
  </body>
</html>
